def process_weather_data(days):
    if not days:
        return None
    result = []
    for d in days:
        if d['update'] != 'yes':
            continue
        date = d['date']
        if d.get('cla') == 'obs':
            high = int(d['maxobs']) if d.get('maxobs') and d['maxobs'].isdigit() else None
            low = int(d['minobs']) if d.get('minobs') and d['minobs'].isdigit() else None
            data_type = 'obs'
        else:
            high = int(d['max']) if d.get('max') and d['max'].isdigit() else None
            low = int(d['min']) if d.get('min') and d['min'].isdigit() else None
            data_type = 'pred'
        hist_high = int(d['hmax']) if d.get('hmax') and d['hmax'].isdigit() else None
        hist_low = int(d['hmin']) if d.get('hmin') and d['hmin'].isdigit() else None

        result.append({
            'date': date,
            'sort_key': int(date),
            'high': high,
            'low': low,
            'hist_high': hist_high,  # 新增历史高温
            'hist_low': hist_low,    # 新增历史低温
            'type': data_type,
            'des': d.get('des', ''),
        })

    result.sort(key=lambda x: x['sort_key'])
    return result